package com.wedo.mall.activity.user;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.widget.TextView;

import com.e.library.activity.EActivity;
import com.e.library.http.EApi;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.wedo.mall.R;
import com.wedo.mall.adapter.GoodsAdapter;
import com.wedo.mall.entity.Goods;
import com.wedo.mall.ptr.Pull2Refresh;

import butterknife.BindView;

public class IntegralShopActivity extends EActivity {

    @BindView(R.id.tv_empty) TextView tv_empty;
    @BindView(R.id.rv_list) XRecyclerView rv_list;
    private GoodsAdapter mGoodsAdapter;

    private Pull2Refresh<Goods> ptr;

    @Override
    protected int layout() {
        return R.layout.activity_integral_shop;
    }

    @Override
    protected void onActivityCreated(Bundle state) {
        rv_list.setHasFixedSize(true);
        rv_list.setLayoutManager(new GridLayoutManager(this,2));

        ptr = new Pull2Refresh<>();

        mGoodsAdapter = new GoodsAdapter(this,null);
        mGoodsAdapter.intergration = true;
        mGoodsAdapter.pointGoodslistener(this);

        ptr.widget(rv_list).adapter(mGoodsAdapter).url(EApi.USER_POINTGOODS).clazz(Goods.class).emptyWidget(tv_empty).done();
    }

}
